// 封装api
// 引入 request 
import http from './request'

// 封装一个登录接口
export const loginApi = (params) =>http.post('/login',params)

// 封装侧边栏 
export const getMenusApi = (params) =>http.get('/menus',{params})

// 获取用户列表
export const  getUserApi = (params)=>http.get('/users',{params})

// 修改用户状态的接口

export const  updateStatusAPi = (params)=>http.put(`users/${params.id}/state/${params.mg_state}`)

// 删除用户接口
export const  deleteUserApi = (params)=>http.delete(`users/${params.id}`)
// 添加用户的api

export const  addUserApi = (params)=>http.post('/users',params)

// 编辑用户的api
export const  editUserApi = (id,params)=>http.put(`/users/${id}`,params)